package com.yan.service.criteria.query;

public class GroupBy implements Comparable {

    /**
     * 数据库字段
     */
    private String sqlColumn;
    /**
     * 开启关闭: true 开启， false 关闭
     */
    private boolean isOpen;

    private int sort;


    @Override
    public int compareTo(Object o) {
        if (o instanceof GroupBy) {
            return this.sort - ((GroupBy) o).getSort();
        }
        return 1;
    }

    public GroupBy(String sqlColumn, boolean isOpen, int sort) {
        this.sqlColumn = sqlColumn;
        this.isOpen = isOpen;
        this.sort = sort;
    }

    public String getSqlColumn() {
        return sqlColumn;
    }

    public void setSqlColumn(String sqlColumn) {
        this.sqlColumn = sqlColumn;
    }

    public boolean isOpen() {
        return isOpen;
    }

    public void setOpen(boolean open) {
        isOpen = open;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }
}
